{% extends "admin_base.html" %}

{% block title %}分类目录列表{% endblock %}

{% block content %}
  <ul class="menu">
    <a href="/admin/category/create/">添加目录</a>
  </ul>
  <table>
    <tr>
      <th>目录名</th>
      <th>文章数</th>
      <th>操作</th>
    </tr>
  
    {% for category in category_list %}
      <tr>
        <td>{{ category.name }}</td>
        <td>{{ category.count }}</td>
        <td>
          {% if not forloop.first %}
          <a href="/admin/category/update/{{ category.id }}/">编辑</a> |
          <a href="/admin/category/delete/{{ category.id }}/">删除</a>
          {% endif %}
        </td>
      </tr>
    {% endfor %}
  </table>

  <div>{% include "pagination.html" %}</div>
{% endblock %}
